package com.yc.spring;

import com.yc.spring.bank.bean.Account;
import com.yc.spring.bank.bean.Record;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringIOC {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext ctx;
        // 初始化IOC容器
        ctx = new ClassPathXmlApplicationContext("beans.xml");

        Account account = (Account) ctx.getBean("bean1"); // name ==> id
        System.out.println(account);
        Record record = ctx.getBean(Record.class);
        System.out.println(record);

    }

}
